package com.hqyj.utile;

import com.hqyj.pojo.User;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class GetTime {
    public static Date getNowTime(){
        Date date = new Date();
        return date;
    }

    public static List<User> transferToTime(List<User> list){
        String strDateFormat = "yyyy-MM-dd HH:mm:ss";
        SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
        for (User user : list) {
            System.out.println(user.getLoginTime());
            System.out.println(sdf.format(user.getLoginTime()));
        }
        return list;
    }
}
